$(document).ready(function(){
  $('div.nonrequired-field').hide();
  $('a.hide-nonrequired-link').hide();

  $('a.show-nonrequired-link').click(function() {
    $('a.show-nonrequired-link').hide();
    $('div.nonrequired-field').show();
    $('a.hide-nonrequired-link').show();
    return false;
  });

  $('a.hide-nonrequired-link').click(function() {
    $('a.hide-nonrequired-link').hide();
    $('div.nonrequired-field').hide();
    $('a.show-nonrequired-link').show();
    return false;
  });
  
   $('#vacation-start-datepicker').datepick({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'yy-mm-dd'
  });
  $('#vacation-end-datepicker').datepick({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'yy-mm-dd'
  });
  $('#birthday-datepicker').datepick({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'yy-mm-dd'
  });

  $('#vacations-calendar').datepick({
    beforeShowDay: $.datepick.noWeekends,
    numberOfMonths: [1, 3], 
    stepMonths: 1,
    dateFormat: 'yy-mm-dd',
    multiSelect: 3
  }).datepick('setDate', VACATIONS_DATES);
});
